<?php

/**
 * ProductTranslation filter form base class.
 *
 * @package    jobeet
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: BaseProductTranslationFormFilter.class.php 7 2011-04-20 11:17:06Z Inoryy@gmail.com $
 */
abstract class BaseProductTranslationFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'slug'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'name'            => new sfWidgetFormFilterInput(),
      'volume'          => new sfWidgetFormFilterInput(),
      'description'     => new sfWidgetFormFilterInput(),
      'longdescription' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'slug'            => new sfValidatorPass(array('required' => false)),
      'name'            => new sfValidatorPass(array('required' => false)),
      'volume'          => new sfValidatorPass(array('required' => false)),
      'description'     => new sfValidatorPass(array('required' => false)),
      'longdescription' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('product_translation_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProductTranslation';
  }

  public function getFields()
  {
    return array(
      'id'              => 'Number',
      'slug'            => 'Text',
      'name'            => 'Text',
      'volume'          => 'Text',
      'description'     => 'Text',
      'longdescription' => 'Text',
      'lang'            => 'Text',
    );
  }
}
